<h:panelGroup layout="block"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:nxd="http://nuxeo.org/nxweb/document"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:f="http://java.sun.com/jsf/core">


<a4j:outputPanel layout="block" id="userSessionsMessages">
  <h:messages />
</a4j:outputPanel> <h:outputText
  value="#{messages['adminsubtab.usersActivity.userSessions.total']}" /><f:verbatim>&amp;nbsp;</f:verbatim>
<h:outputText value="#{nbActiveUserHttpSessions}" /> <br />
<h:outputText
  value="#{messages['adminsubtab.usersActivity.requests.total']}" /><f:verbatim>&amp;nbsp;</f:verbatim>
<h:outputText value="#{nbUserRequests}" /> <br />

<a4j:outputPanel id="usersHttpSessionsListing" layout="block">

  <h:form>
    <h:outputText
      value="#{messages['adminsubtab.usersActivity.userSessions.timerange']}" /> :
    <h:selectOneListbox class="dataInputText" size="1"
      value="#{usersActivityInfo.selectedHttpSessionsTimeRange}">
      <f:ajax execute="@this" render="usersHttpSessionsListing userSessionsMessages" event="change" />
      <nxu:selectItems value="#{usersActivityInfo.httpSessionsTimeRanges}"
        var="itype" itemValue="#{itype.value}"
        itemLabel="#{messages[itype.label]}" />
    </h:selectOneListbox>
  </h:form>

  <h:form>
    <nxu:dataTable id="userSessionTable" value="#{userHttpSessions}"
      var="row" rowClasses="dataRowEven,dataRowOdd" styleClass="dataOutput">

      <!--  Login -->
      <nxu:column>
        <f:facet name="header">
          <h:outputText value="#{messages['label.userSession.login']}" />
        </f:facet>
        <h:outputText value="#{row.loginName}">
        </h:outputText>
      </nxu:column>

      <!--  Inactivity -->
      <nxu:column>
        <f:facet name="header">
          <h:outputText value="#{messages['label.userSession.inactivity']}" />
        </f:facet>
        <h:outputText value="#{row.inactivityAsString}" />
      </nxu:column>

      <!--  Pages count -->
      <nxu:column>
        <f:facet name="header">
          <h:outputText value="#{messages['label.userSession.requests']}" />
        </f:facet>
        <h:outputText value="#{row.accessedPagesCount}" />
      </nxu:column>


      <!--  Duration -->
      <nxu:column>
        <f:facet name="header">
          <h:outputText value="#{messages['label.userSession.duration']}" />
        </f:facet>
        <h:outputText value="#{row.durationAsString}" />
      </nxu:column>

      <!--  principal -->
      <nxu:column>
        <f:facet name="header">
          <h:outputText value="#{messages['label.userSession.lastUrl']}" />
        </f:facet>
        <h:outputText value="#{row.lastAccessUrl}" />
      </nxu:column>

      <!--  comment -->
      <nxu:column>
        <f:facet name="header">
          <h:outputText value="#{messages['label.userSession.lastActivity']}" />
        </f:facet>
        <h:outputText value="#{row.lastAccessDate}">
          <f:convertDateTime type="both" dateStyle="medium"
            timeStyle="medium" timeZone="#{timeZone}" />
        </h:outputText>
      </nxu:column>
    </nxu:dataTable>

  </h:form>
</a4j:outputPanel>

</h:panelGroup>